package net.zjitc.pojo.em;

import lombok.AllArgsConstructor;
import lombok.Getter;

//用户角色列举
@Getter
@AllArgsConstructor
public enum RoleEnum {

    ADMIN(1, "管理员"),
    USER(2, "用户");

    private final Integer role;

    private final String name;

    public static String ROLE(Integer role) {
        for (RoleEnum value : RoleEnum.values()) {
            if (value.getRole().equals(role)) {
                return value.name;
            }
        }
        return null;
    }

}
